package com.aaa.service.logMonitor.impl;

import com.aaa.dao.logMonitor.LogDao;
import com.aaa.entity.PageSortEntity;
import com.aaa.entity.logMonitor.Log;
import com.aaa.entity.systemmanage.Dept;
import com.aaa.service.logMonitor.LogService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Log)表服务实现类
 *
 * @author makejava
 * @since 2022-09-02 14:59:10
 */
@Service("logService")
public class LogServiceImpl implements LogService {

    @Resource
    private LogDao logDao;


    @Override
    public Page queryAll(PageSortEntity pageSortEntity, Log log) {
        //分页
        PageHelper.startPage(pageSortEntity.getPage(), pageSortEntity.getLimit(),pageSortEntity.getOrderString());
        List<Log> logs = logDao.queryAll(log);
        Page pageResult = (Page) logs;
        return pageResult;
    }

    @Override
    public Log insert(Log log) {
        logDao.insert(log);
        return log;
    }
}
